package com.mioto.ld.module.device.model.app;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author mioto-qinxj
 * @date 2024/6/8
 * @desc
 */
@Getter
@Setter
@ApiModel("app首页数据集合-设备数量/位置分类统计")
public class AppDeviceMainPageCounterVO {
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String[] deviceSns;
    @ApiModelProperty("总数量")
    private int totalCount;
    @ApiModelProperty("在线数量")
    private int onlineCount;
    @ApiModelProperty("离线数量")
    private int offlineCount;

    private List<AppDeviceMainPageAddressVO> addressVOList;

    public void setSn(String sn){
        if (StrUtil.isNotEmpty(sn)){
            deviceSns = StrUtil.splitToArray(sn,StrUtil.C_COMMA);
        }
    }
}
